package com.zd.commodity.categoryMng.entity;

import java.sql.Timestamp;
import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.zd.commodity.brandMng.entity.BrandShow;

/**
 * ProductCategory entity. @author MyEclipse Persistence Tools
 */

public class Category implements java.io.Serializable {

	// Fields

	private Long id;
	@JSONField(name="text")
	private String name;
	private Integer level;
	@JSONField(name="href")
	private String url;
	private String status;
	private Long parentId;
	private Long updater;
	private Timestamp createTime;
	private Timestamp updateTime;
	@JSONField(name="nodes")
	private List<Category> categorys;
	private long[] tags;
	private List<BrandShow> brandShows;

	// Property accessors

	public List<BrandShow> getBrandShows() {
		return brandShows;
	}

	public void setBrandShows(List<BrandShow> brandShows) {
		this.brandShows = brandShows;
	}

	public long[] getTags() {
		return new long[]{id,level};
	}

	public void setTags(long[] tags) {
		this.tags = tags;
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}


	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Long getParentId() {
		return this.parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public Long getUpdater() {
		return updater;
	}

	public void setUpdater(Long updater) {
		this.updater = updater;
	}

	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	public Timestamp getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	public List<Category> getCategorys() {
		if(this.level!=null && !this.level.equals("")){
			return this.level==4?null:categorys;
		}else{
			return categorys;
		}
	}

	public void setCategorys(List<Category> categorys) {
		this.categorys = categorys;
	}

}